package com.itheima.Lambda;

import java.util.Arrays;
import java.util.Comparator;

public class Test {
    public static void main(String[] args) {
        Integer[] arr = {2, 4, 6, 1, 9, 3, 0, 7};
        Arrays.sort(arr, new Comparator<Integer>() {
            @Override
            public int compare(Integer i1, Integer i2) {
                return i2.compareTo(i1);
            }
        });
        System.out.println(Arrays.toString(arr));

        Integer[] arr2 = {2, 4, 6, 1, 9, 3, 0, 7};
        Arrays.sort(arr,(a,b)->b.compareTo(a));

        System.out.println(Arrays.toString(arr));
    }
}
